﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_MSDS_Section06View
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hidMSDSID.Value = IIf(IsNothing(Request.QueryString("Id")), 0, CInt(Request.QueryString("Id")))
            ShowData()
        End If
    End Sub
    Protected Sub Translate()
        lblSection06Header.Text = getTranslate("lblSection06Header", Session("LanguageId"), lblSection06Header.Text)
        lblS611.Text = getTranslate("lblS611", Session("LanguageId"), lblS611.Text)
        lblS621.Text = getTranslate("lblS621", Session("LanguageId"), lblS621.Text)
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            'Tiêu đề doanh nghiệp
            Dim lang = CInt(Session("LanguageId"))
            Dim Id As Integer = hidMSDSID.Value
            Dim p As MSDSSection06 = (From a In data.MSDSSection06 Where a.MSDSId = Id And a.LanguageId = lang).SingleOrDefault
            If Not IsNothing(p) Then
                hidID.Value = p.Section06Id

                'Content
                lblViewS611.Text = IIf(IsNothing(p.S611) = True, "", p.S611)
                lblViewS621.Text = IIf(IsNothing(p.S621) = True, "", p.S621)
            End If
            'Label
            Translate()
        End Using
    End Sub
End Class
